package com.itheima.d2_inner_class2;

public class Practice {
    public static void main(String[] args) {
        Animal a = new Animal(){
            @Override
            public void cry() {
                System.out.println("汪汪汪的叫");
            }
        };
        a.cry();

        new Fly(){
            @Override
            public void fly() {
                System.out.println("小鸟在飞～");
            }
        }.fly();
    }
}

abstract class Animal{
    public abstract void cry();
}

interface Fly{
    void fly();
}
